﻿namespace SLS.ExClassLib.MultiThreading.Patterns.Decorators
{
    public abstract class Decorator<T> : IDecorator<T>
    {
        private readonly T _target;

        /// <summary>
        /// Constructs a new Decorator for a default (<see cref="T"/>) target
        /// </summary>
        protected Decorator()
            : this(default(T))
        {
        }

        /// <summary>
        /// Constructs a new Decorator for a specified target.
        /// </summary>
        /// <param name="target">The target.</param>
        protected Decorator(T target)
        {
            _target = target;
        }

        #region IDecorator<T> Members

        /// <summary>
        /// An accessor for the target <see cref="T"/>
        /// </summary>
        public virtual T Target
        {
            get { return _target; }
        }

        #endregion
    }
}